package com.share;

import android.content.Intent;
import android.os.Bundle;

public class AndroidChiaSeThongTinActivity extends BaseActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		if (!this.getIsLogined()) {
			Intent intent = new Intent(this, LoginActivity.class);
			startActivity(intent);
			this.finish();
		}else{
			//show events
			Intent intent = new Intent(this, EventActivity.class);
			startActivity(intent);
			this.finish();
		}
		
		
//		setContentView(R.layout.main);
//		
//		Button btnLogout = (Button)findViewById(R.id.btnLogout);
//		btnLogout.setOnClickListener(new OnClickLogout());
	}
	
	/**
	 * Action logout the system
	 * @author NguyenVanTien
	 *
	 */
//	private class OnClickLogout implements OnClickListener{
//
//		@Override
//		public void onClick(View v) {
//			// TODO Auto-generated method stub
//			SharedPreferences settings = getSharedPreferences("pref_login", 0);
//			SharedPreferences.Editor editor = settings.edit();
//			editor.putString("username", "");
//			editor.putString("password", "");
//			editor.commit();
//			
//			//show login form
//			Intent intent = new Intent(AndroidChiaSeThongTinActivity.this, 
//					LoginActivity.class);
//			startActivity(intent);
//			AndroidChiaSeThongTinActivity.this.finish();
//		}
//	}
}